<html>
<head>
<meta charset="UTF-8">
<title>ftp插件信息配置表详情</title>
	<link  id="easyuiTheme" href="../../static/easyui/themes/bootstrap/easyui.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/easyui/themes/icon.css" rel="stylesheet" type="text/css"/>
	<link href="../../static/css/esaas-easyui-view.css" rel="stylesheet" type="text/css"/>
	<script src="../../static/easyui/jquery.min.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.cookie.js" type="text/javascript"></script>
	<script src="../../static/easyui/ui-theme.js" type="text/javascript"></script>
	<script src="../../static/easyui/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
	<script src="../../static/easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.util.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.jquery.ajax.js" type="text/javascript"></script>
	<script src="../../static/plugin/assets/jslib.easyui.util.js" type="text/javascript"></script>
	<script src="../../ffres/dict/all.js" type="text/javascript"></script>
	<a href="" target="_blank" id="commonLink" name="commonLink"></a>
</head>
<body class="easyui-layout">

	    <form id="ff" method="post">
	    	<div class="esaas-info-title">ftp插件信息配置表信息</div>
	    	<table class="esaas-info-view-table">
			<tr>
				<td width="15%" align="right">配置标识符：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					id="pluginConfId" name="pluginConfId" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">配置顺序：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="confSort" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">连接服务类型：</td>
				<td width="35%"><select class="easyui-combobox" id="serverType"
					name="serverType" style="width: 100%; height: 25px;"
					data-options="disabled:true,editable:false,valueField:'enname',textField:'cnname',data:FILE_SERVER_TYPE">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right">地址：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="sftpServerIp" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">端口：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="ftpServerPort" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">用户名：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="ftpServerUser" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
				<td width="15%" align="right">密码：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					name="ftpServerPwd" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right">操作类型：</td>
				<td width="35%"><select class="easyui-combobox" id="loadType"
					name="loadType" style="width: 100%; height: 25px;"
					data-options="disabled:true,editable:false,valueField:'enname',textField:'cnname',data:FILE_OPT_TYPE,onSelect: doLoadTypeSelect">
				</select></td>
			</tr>
			<tr>
				<td width="15%" align="right" id="ftpFilePathLable">服务器文件路径：</td>
				<td colspan="3"><input class="easyui-textbox" type="text"
					id="ftpFilePath" name="ftpFilePath" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right" id="remoteFileNameLable">服务器文件名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					id="remoteFileName" name="remoteFileName" data-options="disabled:true"
					style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right" id="localFilePathLable">本地路径：</td>
				<td colspan="3"><input class="easyui-textbox" type="text"
					id="localFilePath" name="localFilePath"
					data-options="disabled:true" style="width: 100%; height: 25px;"></input></td>
			</tr>
			<tr>
				<td width="15%" align="right" id="localFileNameLable">本地文件名称：</td>
				<td width="35%"><input class="easyui-textbox" type="text"
					id="localFileName" name="localFileName"
					data-options="disabled:true" style="width: 100%; height: 25px;"></input></td>
			</tr>
		</table>
	    </form>
	    <div class="esaas-info-buttons">
			<a href="javascript:void(0)" class="easyui-linkbutton" iconCls="icon-cancel" onclick="closeForm()" style="width:90px">&nbsp;关&nbsp;闭&nbsp;</a>
		</div>
	</div>
	<script>	
		$(function() {
		    addTitle("查看")
			var pluginConfId = $.getUrlParam('pluginConfId');
			var confSort = $.getUrlParam('confSort');
			$.restfulGet('../../api/plugin/ftp/conf/' + pluginConfId + '/' + confSort,null,function(data){
					$('#ff').form('load', {
						serverType : data.rows.serverType,
						pluginConfId : data.rows.pluginConfId,
						confSort : data.rows.confSort,
						sftpServerIp : data.rows.sftpServerIp,
						ftpServerPort : data.rows.ftpServerPort,
						ftpServerUser : data.rows.ftpServerUser,
						ftpServerPwd : data.rows.ftpServerPwd,
						loadType : data.rows.loadType,
						remoteFileName : data.rows.remoteFileName,
						localFileName : data.rows.localFileName,
						ftpFilePath : data.rows.ftpFilePath,
						localFilePath : data.rows.localFilePath,
						checkExist  : data.rows.checkExist 
					});		
					doLoadTypeSelect({enname: data.rows.loadType});
			});
		});
		/*下拉框选择处理*/
		function doLoadTypeSelect(data) {
			
			if(data.enname == 'upload'){
				//上传处理
				$("#ftpFilePath").textbox("textbox").validatebox('options').required = true;
				
				$("#remoteFileName").textbox("textbox").validatebox('options').required = false;
				$("#remoteFileName").textbox('disable');
				$("#remoteFileName").textbox('setValue', '');
				
				$("#localFilePath").textbox("textbox").validatebox('options').required = true;
				
				$("#localFileName").textbox("textbox").validatebox('options').required = true;
				
			}else{
				//下载处理
				$("#ftpFilePath").textbox("textbox").validatebox('options').required = true;
				
				$("#remoteFileName").textbox("textbox").validatebox('options').required = true;
				
				$("#localFilePath").textbox("textbox").validatebox('options').required = true;
				
				$("#localFileName").textbox("textbox").validatebox('options').required = false;
				$("#localFileName").textbox('disable');
				$("#localFileName").textbox('setValue', '');
			}
		}
		function closeForm(){
			window.parent.JLEUtil.closewin();
		}
	</script>
</body>
</html>
